home *** CD-ROM | disk | FTP | other *** search
/ Champak 120 / Vol 120.iso / games / titans / game.swf / scripts / frame_4 / DoAction.as
Text File  |  2010-11-09  |  1KB  |  55 lines

  1. Movieclip.prototype.fadescreen = function(speed)
  2. {
  3.    if(!speed)
  4.    {
  5.       var speed = 5;
  6.    }
  7.    _root.createemptymovieclip("dark",1000001);
  8.    var d = _root.dark;
  9.    with(d)
  10.    {
  11.       lineStyle(1,0,100);
  12.       beginfill(0,100);
  13.       moveto(-5000,-5000);
  14.       lineto(5000,-5000);
  15.       lineto(5000,5000);
  16.       lineto(-5000,5000);
  17.       endfill();
  18.       d.onEnterFrame = function()
  19.       {
  20.          _alpha -= speed;
  21.          if(_alpha <= 0)
  22.          {
  23.             removeMovieClip("");
  24.             stop();
  25.          }
  26.       };
  27.    }
  28. };
  29. movieclip.prototype.makecrash_instruction = function(tipe1, tipe2, total)
  30. {
  31.    var i = 0;
  32.    while(i < total)
  33.    {
  34.       this.attachmovie("crashing","rub" + this.rd,this.rd);
  35.       var ska = 60 + random(40);
  36.       var rbb = this["rub" + this.rd];
  37.       rbb._xscale = ska;
  38.       rbb._yscale = ska;
  39.       rbb._x = -40 + random(80);
  40.       rbb._y = -40 + random(80);
  41.       rbb.vx = 0.2 * this.vx;
  42.       rbb.vy = 0.2 * this.vy;
  43.       if(random(100) > 50)
  44.       {
  45.          rbb.tipe = tipe1;
  46.       }
  47.       else
  48.       {
  49.          rbb.tipe = tipe2;
  50.       }
  51.       this.rd = this.rd + 1;
  52.       i++;
  53.    }
  54. };
  55.